var obj1 = {a: {b: 1}}
var obj2 = Object.assign({}, obj1)
obj1.a.b = 2
console.log(obj2) // { a: { b: 2 } }

var Person = function (name, age) {
  this.name = name
  this.age = age
  this.greed = function() {
    console.log('Hello, I am ', this.name)
  }
}
function Student () {

}
var stud = new Student()
Object.setPrototypeOf(stud, {a: 1})
console.log(Object.getPrototypeOf(stud)) // {a: 1}

var deObj = Object.defineProperties({}, {
  'name': {
    value: 'lear',
    enumerable: true
  },
  'age': {
    value: 10,
    enumerable: false
  },
  'sex': {
    value: 'male',
    enumerable: true
  },
  'symble': {
    value: Symbol('1')
  }
})
console.log(deObj) // { name: 'lear', sex: 'male' }
for (x in deObj) {
  console.log(x, deObj[x]) // name lear  sex male   说明不包含不可枚举
}
console.log(Object.keys(deObj)) // [ 'name', 'sex' ] 说明不包含不可枚举

console.log('age' in deObj) // true   包含不可枚举

console.log(Object.getOwnPropertyNames(deObj)) // [ 'name', 'age', 'sex', 'symble' ] 说明包含不可枚举


// 返回参数对象的全部Symble属性 不可枚举的获取不到
console.log(Object.getOwnPropertySymbols(deObj)) // []


// 返回全部属性  无论可不可枚举
console.log(Reflect.ownKeys(deObj)) 